struct Person {
    name: String,
    last_name: String,
    age: u32,
}

impl Person {
    // associated function
    fn some_func() {
        println!("some_func");
    }

    // method
    // 调用方法会把自己move进去(self)，
    // 后面的方法就用不了该实例了
    // fn display_age(self) {
    // 相对于下面的写法
    // fn display_age(&self) {
    fn display_age(self: &Self) {
        println!("current age: {}", self.age)
    }
}
fn main() {
    Person::some_func();

    let p = Person {
        name: "Filip".to_string(),
        last_name: "Jerga".to_string(),
        age: 30,
    };

    p.display_age();

    println!("{} {} {}", p.name, p.last_name, p.age);
}
